/**
 * 远程数据接口 / Remote data interface
 */
interface RemoteData<T> {
    type: RemoteType;
    data: T;
}

/**
 * 客户端事件枚举 / Client event enumeration
 */
enum ClientEvents {
    /**
     * 对话 / Dialog
     */
    DIALOG = 'dialog',
    /**
     * 对话键 / Dialog key
     */
    DIALOG_KEY = 'dialogKey',
    /**
     * 对话关闭 / Dialog close
     */
    DIALOG_CLOSE = 'dialogClose',
}

/**
 * 服务器事件枚举 / Server event enumeration
 */
enum ServerEvents {
    /**
     * 语言 / Language
     */
    LANGUAGE = 'language',
    /**
     * 对话结束 / Dialog end
     */
    DIALOG_END = 'dialogEnd',
}

/**
 * 远程类型枚举 / Remote type enumeration
 */
enum RemoteType {
    /**
     * 语言 / Language
     */
    LANGUAGE = 'language',
    /**
     * 对话 / Dialog
     */
    DIALOG = 'dialog',
    /**
     * 对话结束 / Dialog end
     */
    DIALOG_END = 'dialogEnd',
    /**
     * 对话键 / Dialog key
     */
    DIALOG_KEY = 'dialogKey',
    /**
     * 对话关闭 / Dialog close
     */
    DIALOG_CLOSE = 'dialogClose',
}

/**
 * 语言信息 / Language information
 */
interface Language {
    lng: string;
}

/**
 * 对话信息 / Dialog information
 */
interface DialogData {
    title: string;
    content: string[];
}

/**
 * 对话键 / Dialog key
 */
interface DialogKeyData {
    key: string;
    params: object;
}

/**
 * 对话关闭 / Dialog close
 */
type DialogCloseData = null;

/**
 * 对话结束
 */
type DialogEndData = null;

/**
 * 远程数据接收值类型 / Remote data received value type
 */
type RemoteDataType =
    | RemoteData<Language>
    | RemoteData<DialogData>
    | RemoteData<DialogEndData>
    | RemoteData<DialogKeyData>
    | RemoteData<DialogCloseData>;

export {
    RemoteData,
    RemoteType,
    RemoteDataType,
    ClientEvents,
    ServerEvents,
    Language,
    DialogData,
    DialogEndData,
    DialogKeyData,
    DialogCloseData,
};
